<!DOCTYPE html>
<?php 
if( $sf_params->get('culture') ) {
	$sf_user->setCulture( $sf_params->get('culture') );
}
else {
	if( !$sf_user->getCulture() ) {
		$sf_user->setCulture( 'th_TH' );
	}
}

$culture = $sf_user->getCulture();
?>
<!--[if lt IE 7 ]><html class="ie ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]><html class="ie ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!-->
<html lang="en">
	<!--<![endif]-->
	<head>
		<meta charset="utf-8">
		<title>กรมอุตุวิทยา</title>
		<link type="text/css" rel="stylesheet" href="<?php echo _compute_public_path("/css/style.css", "css", false)?>">
		<!--[if lte IE 9]><link type="text/css" rel="stylesheet" href="<?php echo _compute_public_path("/css/ie.css", "css", false)?>"><![endif]-->
		<link rel="stylesheet" type="text/css" href="<?php echo _compute_public_path("/css/megamenu.css", "css", false)?>" media="screen" />
		<link rel="stylesheet" type="text/css" href="<?php echo _compute_public_path("/css/zozo.tabs.css", "css", false)?>" />
		<link rel="stylesheet" type="text/css" href="<?php echo _compute_public_path("/css/horizontal.css", "css", false)?>" media="screen" />
		<link rel="stylesheet" type="text/css" href="<?php echo _compute_public_path("/dzsscroller/scroller.css", "css", false)?>" />
		<link rel="stylesheet" type="text/css" href="<?php echo _compute_public_path("/css/left-menu.css", "css", false)?>" />
		<link rel="stylesheet" type="text/css" href="<?php echo _compute_public_path("/css/inner-tab.css", "css", false)?>" />
		<link rel="stylesheet" type="text/css" href="<?php echo _compute_public_path("/css/jqtransform.css", "css", false)?>" />
		<link rel="stylesheet" type="text/css" href="<?php echo _compute_public_path("/touchcarousel/touchcarousel.css", "css", false)?>" />
		<link rel="stylesheet" type="text/css" href="<?php echo _compute_public_path("/touchcarousel/grey-blue-skin/grey-blue-skin.css", "css", false)?>" />
		<link rel="stylesheet" type="text/css" href="<?php echo _compute_public_path("/ws/ws-combo.css", "css", false)?>" /> 
		<!--[if lt IE 9]><script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> <![endif]-->
		<!--[if lt IE 9]><script src="<?php echo _compute_public_path("/js/css3-mediaqueries.js", "css", false)?>"></script><![endif]-->
		
		<script type="text/javascript" src="<?php echo _compute_public_path("/js/jquery.min.js", "js", false)?>"></script>
		<script type="text/javascript" src="<?php echo _compute_public_path("/js/jquery.easing.min.js", "js", false)?>"></script>
		<script type="text/javascript" src="<?php echo _compute_public_path("/js/cleantabs2.jquery.js", "js", false)?>"></script>
		<script type="text/javascript" src="<?php echo _compute_public_path("/ws/ws-combo.js", "js", false)?>"></script>
		<script type="text/javascript" src="<?php echo _compute_public_path("/js/zozo.tabs.min.js", "js", false)?>"></script>
		<script type="text/javascript" src="<?php echo _compute_public_path("/dzsscroller/scroller.js", "js", false)?>"></script>
		<script type="text/javascript" src="<?php echo _compute_public_path("/js/jquery.elegantcarousel.min.js", "js", false)?>"></script>
		<script type="text/javascript" src="<?php echo _compute_public_path("/js/jquery.jqtransform.js", "js", false)?>"></script>
		<script type="text/javascript" src="<?php echo _compute_public_path("/touchcarousel/jquery.touchcarousel-1.1.min.js", "js", false)?>"></script>
		<script type="text/javascript" src="<?php echo _compute_public_path("/js/jquery.jAccordion-1.2.5.js", "js", false)?>"></script>
		<script type="text/javascript">
			var callLastFuncs = [];
		</script>
	</head>
	<body>
	    <div id="globalWrapper">
	        <?php echo $sf_content ?>
	        <!-- footer -->
	        <?php include_partial('global/footer')?>
	        <!-- footer -->
	    </div>
	</body>
	
	<script type="text/javascript">
		var baseURL = 'http://tmd.local/index.php/';
	</script>
	<script type="text/javascript" src="<?php echo url_for( "TMDAPI/tmd" )?>"></script>
	<script type="text/javascript" src="<?php echo _compute_public_path("/js/custom.js", "js", false)?>"></script>
	<script type="text/javascript">
	$(function() {
	    
	    <?php if( $sf_params->get('module') == 'home' && $sf_params->get('action') == 'index' ):?>
		applyGeographicRegions();
	    <?php endif;?>
	    
	    <?php if( $sf_params->get('module') == 'forecast' && $sf_params->get('action') == 'index' ):?>
	    applyGeographicRegions();
	    <?php endif;?>

	    /* Call registered functions */
		if( callLastFuncs.length > 0 ) {
			for( var i in callLastFuncs ) {
				eval( callLastFuncs[i] );
			}
		}
	});
	</script>
</html>
